<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        function concurrentRequest(urls, limit) {
            return new Promise((resolve, reject) => {
                while(urls.length) {
                    let arr = urls.splice(0, limit)
                    request(arr)
                }
                let res = []  // 存结果
                let index = 0 // 下标保证顺序
                let count = 0 // 记录请求的次数
                function request(urlArr) {
                    let i = index
                    const url = urlArr[index    ]
                    index++
                    try {
                        const res = fetch(url)
                    }catch(err) {

                    }
                    finally{

                    }
                }  
            })
        }
    </script>
</body>
</html>